<template>
    <div>
        组件1
        {{this.$store.state.count}}
        <button @click="add">点击</button>
    </div>
</template>
<script>
export default {
    data () {
        return {
           name:"zs"
        }
    },
    methods: {
        add(){
            this.$store.commit("addcount", this.name)
        }
    }
}
</script>
 <style>
 
 </style>
 

